function debounce(fn,delay){

    let timer=null
    return function (...args){
    clearTimeout(timer)
     timer = setTimeout(()=>{
        fn.call(this,...args)
      },delay)
    }
}
function throttle(fn,delay){
   let oldTimer=Data.now()
   return function (...args){
    let curTime=Data.now()
    if(oldTimer-curTime>=delay){
        fn.call(this,...args)
        oldTimer=Data.now()
    }
   }





}